WindowManager:
    MainWindow:
    SecondWindow:

<MainWindow>:
    name:"Main"

    GridLayout:
        cols: 1

        GridLayout:
            cols: 2

            Label:
                text: "Password"
            TextInput:
                id: passw
                multiline: False
        Button:
            text: "Submit"
            on_release:
                app.root.current = "Second" if passw.text == "hello" else "Main"
                root.manager.transition.direction = "left"  #moving direction

<SecondWindow>:
    name: "Second"

    Button:
        text: "Go Back"
        on_release:
            app.root.current = "Main"
            root.manager.transition.direction = "right"